package com.google.code.garbagecan.jettystudy.sample6;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;

public class WebAppContextWithFolderServer {
	public static void main(String[] args) throws Exception {
		Server server = new Server(8080);

		// http://localhost:8080/myapp/
		String webPath = WebAppContextWithFolderServer.class.getResource("/com/google/code/garbagecan/jettystudy/sample6").getFile();
		WebAppContext context = new WebAppContext();
		context.setContextPath("/myapp");
		context.setDescriptor(webPath + "/WEB-INF/web.xml");
		context.setResourceBase(webPath);
		context.setParentLoaderPriority(true);
		server.setHandler(context);

		server.start();
		server.join();
	}
}
